$(document).ready(function(){
    var content = $("#meeting-content");
    var meetingContent = content.text();
    var re = new RegExp("\n", "g");
    content.empty();
    content.html(meetingContent.replace(re, "<br/>")).show();

    //$("#meeting-wechart-invite-qrcode").attr("src",  $('#img-qrcode').attr('src'));

    var meetingTime = $("#event-meeting-time");
    meetingTime.empty();
    meetingTime.append($MB.formatDate(parseInt(meetingTime.attr('start')), parseInt(meetingTime.attr('end'))));
    
    var meetingLink = $("#a-meeting-link");
    meetingLink.attr('href', meetingLink.text());

    $("#meeting-event-join-attendee").click(function() {
        var meetingId = $("#event-detail input[name='meeting-id']").val();
        var userId = $("#event-detail input[name='user-id']").val();
        var username = $("#event-detail input[name='username']").val();
        joinMeeting(false, meetingId, userId, username);
    });
    $("#meeting-event-join-moderator").click(function() {
        var meetingId = $("#event-detail input[name='meeting-id']").val();
        var userId = $("#event-detail input[name='user-id']").val();
        var username = $("#event-detail input[name='username']").val();
        joinMeeting(true, meetingId, userId, username);
    });
});